$(document).ready(function(){
    $("a[name='logout']").click(function(){
        if(confirm("您确定要退出系统吗?")){
            $.ajax({
                url: '/logout/',
                success: function (data) {
                    if (data == '1') {
                        alert('您已退出');
                        window.location.href = "/login/"
                    }
                }
            })
        }
    });

    $("a[name='projectManager']").click(function(){
        $("form[name='dataForm']").attr("action","/projectManagePage/");
        $("form[name='dataForm']").submit();
    });
    $("a[name='testCaseManager']").click(function(){
        $("form[name='dataForm']").attr("action","/addCaseTitlePage/");
        $("form[name='dataForm']").submit();
    });
    $("a[name='bugCheck']").click(function(){
        $("form[name='dataForm']").attr("action","/bugCheck/");
        $("form[name='dataForm']").submit();
    });
    $("a[name='registerPage']").click(function(){
        $("form[name='dataForm']").attr("action","/registerPage/");
        $("form[name='dataForm']").submit();
    });
    $("a[name='addMachineInfo']").click(function(){
        $("form[name='dataForm']").attr("action","/notebookAndCellPhoneAndPadInfos/");
        $("form[name='dataForm']").submit();
    });
    $("a[name='projectAndMachinesRelationsPage']").click(function(){
        var projectId = $("#projectId").val();
        window.open('/projectAndMachinesRelationsPage?projectId='+projectId+'&stage=1','_blank');
    });
});